Repository navigation
Hit with no skill on a pet's basic attack - #3633
Conversation
A pet's basic attack resolved cast 0, which matches any skill the pet knows, so a pet with skills of its own swung with the first of them: its reach, cooldown, animation and cards. Sending a NosMate or an escort at a monster with suctl did the same with the packet's first field, and refused to attack at all for a creature with no skills. In the packet traces every hit a pet, partner or escort lands when sent at a monster is skill 0 with animation 11, the creature's own basic cooldown and its EFF value as the effect, whatever suctl's first field holds. Both orders now go through one basic attack: no skill, no cards, reach and cooldown from the creature's data. Its skills are cast only from its skill bar. Fixes #3632 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUfJ46iekh4rbiCyoTamtn
|
No actionable comments were generated in the recent review. WalkthroughPet and escort attack orders now trigger basic attacks instead of selecting pet skills. Basic attack resolution checks the attacker’s map, cooldown, and range, then submits a hit marked as a basic attack. Tests and the manual test plan cover attack data, order handling, and related combat behavior. ChangesPet and escort basic attacks
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant SuCtlPacketHandler
participant MateControlService
participant MateAttackService
participant BattleService
SuCtlPacketHandler->>MateControlService: AttackAsync(owner, mateTransportId, target)
MateControlService->>MateAttackService: BasicAttackAsync(attacker, target)
MateAttackService->>BattleService: Hit with BasicAttack=true
BattleService-->>MateAttackService: Hit result
MateAttackService-->>MateControlService: Attack result
Possibly related PRs
Suggested reviewers: Merge Risk:
|
Checked against the lab server, before and afterBot packets. The bot owned a level 30 pet with skill 790 (vnum 709) and one with no skills (vnum 9). It sent each at a nearby monster five times with
The new values match the packet traces: Not checked in the browser client. A basic attack ordered from 4 cells away sometimes got no answer, while one from 3 cells landed. That looks like the pet's reach limit and is outside this change. Generated by Claude Code Generated by Claude Code |
What
A pet's basic attack asked the skill resolver for cast 0. Cast 0 matches any skill the pet knows, so a pet with skills of its own swung with the first one, using that skill's reach, cooldown, animation and cards. Sending a NosMate or an escort at a monster with
suctlread the packet's first field as a cast id the same way: it cast whichever skill matched it, and a pet with no skills at all could not attack.In the packet traces every hit that a pet, partner or time-space escort lands after being sent at a monster is skill 0 with animation 11, the creature's own basic cooldown and its EFF value as the hit effect. That is the same shape as a monster's basic hit. A level 71 pet whose monster data lists a skill (vnum 709, skill 790) hits with
su 2 <pet> 3 <monster> 0 14 11 0 ...: its ZSKILL cooldown is 14 and its EFF is 0. A starter pet (vnum 9) reads0 12 11 200, and an escort NPC (vnum 320) reads0 12 11 200too.suctl's first field follows thec_mapthe client is on, so it never names a skill.What changes:
MateAttackService.BasicAttackAsynctakes any NPC-like creature and hits withHitArguments { BasicAttack = true }, soSkillResolver.ResolveBasichandles it: no skill, no cards, animation 11, the EFF value as the effect, and reach and cooldown from the creature's data.MateControlService.AttackAsync(suctl) uses that same basic attack for a team NosMate and for an escort led by the player, and ignores the first field.u_petwith a skill,u_ps), and those paths are unchanged.Fixes #3632
Tests
MateBasicAttackTests(new, GameObject) uses the real battle service and resolver on a pet that knows a skill with cards. The hit is skill 0 with no cards, and thesuis compared as a typedSuPacketwithPacketAssert: skill 0, the pet's cooldown, animation 11 and the pet's effect. Both tests fail on master.SkillResolverTests.APetsBasicAttackIsItsOwnHitNotTheSkillItKnows(new) runsResolveBasicon a spawned pet. It passes on master too, because the bug was at the call site, not in the resolver.SuCtlPacketHandlerTestsis rewritten for the basic attack: an own pet and an escort hit withBasicAttack, a first field that matches a skill's cast id picks no skill, a pet without skills still attacks, basic range and basic cooldown are enforced, and other players' mates, players and unknown targets are refused. 5 of these fail on master.UpetPacketHandlerTests.APetsBasicAttackIsNoneOfItsSkills(new) fails on master.PetTests.APetSentAtAMonsterHitsItWithItsBasicAttackNotItsSkill(new) sendssuctland expects the pet'ssuto be skill 0 with cooldown 20, animation 11 and effect 0. On master the pet casts skill 220.NosCore.GameObject.Tests(2816) andNosCore.PacketHandlers.Tests(1002) pass. E2EPetTests+PartnerTestspass (9).In the client
Not checked yet. The "Ordering NosMates" section of
documentation/manual-test-plan.mdnow has these steps:sulines read skill 0, animation 11, its own basic cooldown and hit effect (14/0 for vnum 709, 12/200 for vnum 9).Still open
sucooldowns are shorter than the data: a starter pet's first hit on a target reads 12 and later ones mostly 5, and a partner (vnum 319, ZSKILL 12) reads 6. This PR sends the ZSKILL value.AttackClass - 1.sux/y of a basic hit is0 0in the traces. Here it is the attacker's position.SuCtlPacket.CastIdis really the client's map id, andsuctlcan name several mates (suctl <map> 2 <mate> 3 <target> <mate> 3 <target>). Both belong in NosCore.Packets.Generated by Claude Code
Summary by CodeRabbit